using System;
using System.Globalization;

using Xamarin.Forms;

namespace Outcoder.UI.Xaml
{
	public abstract class WrapperConverterBase : IValueConverter
	{
		readonly Data.IValueConverter baseConverter;

		protected WrapperConverterBase(Outcoder.UI.Xaml.Data.IValueConverter baseConverter)
		{
			this.baseConverter = ArgumentValidator.AssertNotNull(baseConverter, "baseConverter");
		}

		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			return baseConverter.Convert(value, targetType, parameter, culture);
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			return baseConverter.ConvertBack(value, targetType, parameter, culture);
		}
	}
}